﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Net.Http.Headers;

namespace MvcSample.Controllers
{
    [Route("api/[controller]/[action]")]
    [ApiController]
    public class BindController : ControllerBase
    {
        //[Route("/bindSource/{id:int}")]
        //public IActionResult Source([FromQuery]int id)
        //{
        //    return Ok(id);
        //}

        [Route("/bindSource")]
        public IActionResult Source([FromQuery]string url)
        {
            return Ok(url);
        }

        //[Route("/bindSource")]
        //public IActionResult Source([FromHeader(Name =HeaderNames.AcceptLanguage)]string  language,[FromHeader(Name =HeaderNames.AcceptCharset)]string charset)
        //{
        //    return Ok($"{language},{charset}");
        //}
    }
}